package com.shaunstone.web.sports.dal.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the person_team_mapping database table.
 * 
 */
@Embeddable
public class PersonTeamMappingPK implements Serializable {
	// default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name = "person_id", insertable = false, updatable = false)
	private int personId;

	@Column(name = "team_id", insertable = false, updatable = false)
	private int teamId;

	public PersonTeamMappingPK(int personId, int teamId) {
		this.personId = personId;
		this.teamId = teamId;
	}

	public PersonTeamMappingPK() {
		// TODO Auto-generated constructor stub
	}

	public int getPersonId() {
		return this.personId;
	}

	public void setPersonId(int personId) {
		this.personId = personId;
	}

	public int getTeamId() {
		return this.teamId;
	}

	public void setTeamId(int teamId) {
		this.teamId = teamId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PersonTeamMappingPK)) {
			return false;
		}
		PersonTeamMappingPK castOther = (PersonTeamMappingPK) other;
		return (this.personId == castOther.personId) && (this.teamId == castOther.teamId);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.personId;
		hash = hash * prime + this.teamId;

		return hash;
	}
}